/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import DataBase.DBConnection;

/**
 *
 * @author fabio
 */
public class Mail {

    private int spam = -1;
    private Header header = null;
    private Content content = null;
    private String filename = "";

    @Override
    public String toString() {
        return "Mail{" + "\n\tspam=" + spam + ", \n\theader=" + header.toString() + ", \n\tcontent=" + content + ", \n\tfilename=" + filename + "\n}";
    }

    public void setSpam(int spam) {
        this.spam = spam;
    }

    public Mail(String filename, int spamLabel) {
        this.filename = filename;
        this.spam = spamLabel;
    }

    public Mail() {
    }

    public void storeInDB() {
        DBConnection.insertMail(this);
    }

    public String getFilename() {
        return filename;
    }

    public void setContent(Content content) {
        this.content = content;
    }

    public void setHeader(Header header) {
        this.header = header;
    }

    public void saveDatabase() {
    }

    public Content getContent() {
        return content;
    }

    public Header getHeader() {
        return header;
    }

    public int getSpam() {
        return spam;
    }
}
